/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JTextArea;
import javax.swing.border.Border;

/**
 *
 * @author goum
 */
public class SentenceView extends JTextArea implements Observer {

    String sentence;

    public SentenceView(String sentence) {
        Insets inset = new Insets(0, 10, 0, 10);
        Font font = new Font("Calibri", Font.BOLD, 28);
        this.setForeground(Color.DARK_GRAY);
        this.setMargin(inset);
        this.setEditable(false);
        this.setFont(font);
        this.setBackground(Color.LIGHT_GRAY);
        this.setPreferredSize(new Dimension(800, 50));
        this.sentence = sentence;
        this.setText(this.sentence);
    }

    public String getSentence() {
        return sentence;
    }

    public void setSentence(String sentence) {
        this.sentence = sentence;
    }

    /**
     * Mie a jour de l'affichage du nombre de pions
     */
    public void update(Observable o, Object ob) {
        String telmessage = (String) ob;
        this.setText(telmessage);
    }
}
